import Vue from "vue";
import Vuex from "vuex";
// import { getToken, getUser, getUserType, getGoodsName } from "@/utils/auth";
Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    // token: getToken() ? getToken() : "",
    // user_type: getUserType() ? getUserType() : 0,
    // name: getUser() ? getUser().nickname : "",
    // goods_name: getGoodsName() ? getGoodsName() : ""
    token: "",
    user_type: 1,
    name: "",
    goods_name: ""
  },
  mutations: {
    SET_NAME(state, name) {
      state.name = name;
    },
    SET_TOKEN(state, token) {
      state.token = token;
    },
    SET_USERTPE(state, user_type) {
      state.user_type = user_type;
    },
    SET_GOODSNAME(state, goods_name) {
      state.goods_name = goods_name;
    }
  },
  actions: {},
  modules: {}
});
